package com.diankangwo.dao.impl;

import com.diankangwo.dao.DistributionDAO;
import com.diankangwo.domain.Distribution;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * Created by wuye on 2017/10/18.
 */
@Repository
public class DistributionDAOImpl extends BaseDaoImpl<Distribution> implements DistributionDAO {

    @Resource
    private SessionFactory sessionFactory;

    /**
     * 添加一个佣金明细
     */
    @Override
    public boolean saveDistribution(Distribution distribution){
        try {
            sessionFactory.getCurrentSession().save(distribution);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
}
